Add patch from upstream PR #1016 to fix a regression
authorSimon McVittie <smcv@debian.org>
Wed, 19 Jul 2017 21:17:00 +0000 (22:17 +0100)
committerSimon McVittie <smcv@debian.org>
Wed, 19 Jul 2017 21:17:00 +0000 (22:17 +0100)
debian/changelog
debian/patches/lib-commit-Fix-EBADF-with-GENERATE_SIZES-option-for-commi.patch [new file with mode: 0644]
debian/patches/series [new file with mode: 0644]

index aef343bb8f9e3601153fb4c97a79edb4ac74e684..0ac3bc43077cbe2dd872e0deddf24cb888217e06 100644 (file)
@@ -3,6 +3,7 @@ ostree (2017.8-1) UNRELEASED; urgency=medium
   * New upstream release
     - Update symbols file
     - Remove patches that are no longer needed
+    - Add patch from upstream PR #1016 to fix a regression
   * Add a Breaks on flatpak (<< 0.8.7-2~), which rely on libostree to
     download the summary and its signature when mirroring.
     libostree >= 2017.7 no longer does this. On affected flatpak versions,
diff --git a/debian/patches/lib-commit-Fix-EBADF-with-GENERATE_SIZES-option-for-commi.patch b/debian/patches/lib-commit-Fix-EBADF-with-GENERATE_SIZES-option-for-commi.patch
new file mode 100644 (file)
index 0000000..fcfa6f0
--- /dev/null
@@ -0,0 +1,57 @@
+From: Colin Walters <walters@verbum.org>
+Date: Wed, 19 Jul 2017 09:19:16 -0400
+Subject: lib/commit: Fix EBADF with GENERATE_SIZES option for commit
+
+Regression from previous tmpfile refactoring; unfortunately
+the `OSTREE_REPO_COMMIT_MODIFIER_FLAGS_GENERATE_SIZES` option
+only has coverage via gjs currently.
+
+Might expose it via the cmdline in a later option, but in the big picture the
+idea was that this data is better kept in static deltas.
+
+Bug: https://github.com/ostreedev/ostree/issues/1014
+Forwarded: https://github.com/ostreedev/ostree/pull/1016
+---
+ src/libostree/ostree-repo-commit.c | 22 +++++++++++-----------
+ 1 file changed, 11 insertions(+), 11 deletions(-)
+
+diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c
+index baeef3f..332f22a 100644
+--- a/src/libostree/ostree-repo-commit.c
++++ b/src/libostree/ostree-repo-commit.c
+@@ -733,6 +733,17 @@ write_content_object (OstreeRepo         *self,
+     }
+   else
+     {
++      /* Update size metadata if configured */
++      if (indexable && object_file_type == G_FILE_TYPE_REGULAR)
++        {
++          struct stat stbuf;
++
++          if (!glnx_fstat (tmpf.fd, &stbuf, error))
++            return FALSE;
++
++          repo_store_size_entry (self, actual_checksum, unpacked_size, stbuf.st_size);
++        }
++
+       /* This path is for regular files */
+       if (!commit_loose_regfile_object (self, actual_checksum, &tmpf,
+                                         uid, gid, mode,
+@@ -742,17 +753,6 @@ write_content_object (OstreeRepo         *self,
+                                   ostree_object_type_to_string (OSTREE_OBJECT_TYPE_FILE));
+     }
+-  /* Update size metadata if configured */
+-  if (indexable && object_file_type == G_FILE_TYPE_REGULAR)
+-    {
+-      struct stat stbuf;
+-
+-      if (!glnx_fstat (tmpf.fd, &stbuf, error))
+-        return FALSE;
+-
+-      repo_store_size_entry (self, actual_checksum, unpacked_size, stbuf.st_size);
+-    }
+-
+   /* Update statistics */
+   g_mutex_lock (&self->txn_stats_lock);
+   self->txn_stats.content_objects_written++;
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644 (file)
index 0000000..44ac8f7
--- /dev/null
@@ -0,0 +1 @@
+lib-commit-Fix-EBADF-with-GENERATE_SIZES-option-for-commi.patch